<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>背景图片位置-方位名词</title>
    <style>
        .div1 {
            width: 300px;
            height: 300px;
            background-color: skyblue;
            background-image: url(img/背景图.png);
            background-repeat: no-repeat;
            background-position: center top;
            /* 水平靠上 */

        }
        .div2 {
            width: 300px;
            height: 300px;
            background-color: skyblue;
            background-image: url(img/背景图.png);
            background-repeat: no-repeat;
            background-position: center right;
            /* 居中靠右 */
        }
        
        .div3 {
            width: 300px;
            height: 300px;
            background-color: skyblue;
            background-image: url(img/背景图.png);
            background-repeat: no-repeat;
            background-position: left;
            /* x轴靠左，y轴未赋值，则默认y轴居中 */
        }
    </style>
</head>
<body>
    <div class="div1"></div>
    <p></p>
    <div class="div2"></div>
    <p></p>
    <div class="div3"></div>
    <img src="img/背景方位方法.png" alt="">
</body>
</html>